from django import template

register = template.Library()

@register.filter(name='is_odd')
def is_odd(number):
    if number % 2 != 0:
        return True
    else:
        return False

@register.filter(name='profile')
def profile(user,property):
    value = ''
    profile = user
    if property == 'city':
        value = profile.city
    if property == 'sex':
        value = profile.sex
    if property == 'posts':
        value = profile.posts
    if property == 'description':
        value = profile.description
    if property == 'rank':
        value = profile.rank
    if property == 'homepage':
        value = profile.homepage
        
    return value
    
    